-- Quick Tools Object --- Work in progres --- -- Version: 0.1 -- Created: 11-4-2008 -- Last Modified: 01-5-2009 -- Support Version: 3ds max 2008/2009/2010 -- Author: Michele71 -- E-mail: Medal71@hotmail.it --- This is a simple Script that allows to be faster in some passages of normal workflow in Max --***************************************************************************************** -- MODIFY THIS AT YOUR OWN RISK. -- Please feel free to modify this code, but let me know so that I can benefit from the changes as well -- Modify added, must be e-mailed to Medal71@hotmail.it --***************************************************************************************** rf = newRolloutFloater "Quick Tools Object v.0.1" 390 420 rollout QTO "Quick Tools Object" width:376 height:288 category:1 ( local obj_array = for i in objects collect i.name GroupBox LOS "List Object Scene" pos:[8,8] width:360 height:272 listbox list "" pos:[16,32] width:184 height:15 items:obj_array button _update "Refresh List Object Scene" pos:[24,240] width:168 height:24 GroupBox grp5 "Select/Delete Object" pos:[208,24] width:152 height:152 button sel "Select All Object" pos:[216,48] width:136 height:24 button selinv "Select Invert Object" pos:[216,80] width:136 height:24 button del "Delete All Object" pos:[216,144] width:136 height:24 button _delete "Delete Object Selected" pos:[216,112] width:136 height:24 GroupBox grp8 "Rename/Clone Object" pos:[208,184] width:152 height:88 button changename "Rename Object Selected" pos:[216,208] width:136 height:24 button _clone "Clone Object " pos:[216,240] width:136 height:24 on list selected nameIndex do select (getNodeByName list.items[nameIndex]) on _update pressed do ( list.items = for i in objects collect i.name ) on sel pressed do ( objarray = for i in $* collect i.name objarray as string objarray.count if objarray.count <= 0 then messagebox "No Object to Select" title:"Select/Delete Object" else select objects ) on selinv pressed do ( objarray = for i in $* collect i.name objarray as string objarray.count if objarray.count <= 0 then messagebox "No Object to Select" title:"Select/Delete Object" else max select invert ) on del pressed do ( if queryBox "Do you want really delete ALL object?" title:"Selected/Delete Object" then delete objects list.items = for i in objects collect i.name ) on _delete pressed do ( objarray = for i in $* collect i.name objarray as string objarray.count if objarray.count <= 0 then messagebox "No Object to Select" title:"Select/Delete Object" else if queryBox "Do you want Delete Object?" title:"Selected/Delete Object" then ( if list.items.count <= 0 then messagebox "No Object in the List" title:"Selected/Delete Object" else delete (getNodeByName list.selected) if list.items.count > 0 and list.selection > 0 then list.items = deleteItem list.items list.selection ) ) on changename pressed do ( rollout newname "New Name Object Selected" ( edittext new_name "" button rename_obj "Ok!" on rename_obj pressed do ( objarray = for i in $* collect i.name objarray as string objarray.count if objarray.count <= 0 then messagebox "No Object for New Name" title:"Rename/Clone Object" else if new_name.text != "" do for i in selection do i.name = new_name.text list.items = for i in objects collect i.name destroydialog newname ) ) createdialog newname 250 50 ) on _clone pressed do ( rollout clone "Quick Clone Object" width:376 height:152 category:2 ( local obj_array = for i in objects collect i.name --------------------------------------------------------------------------------------------------- GroupBox GroupClone "Mode Clone" pos:[8,8] width:360 height:104 button cloneOk "Ok!" pos:[232,80] width:128 height:24 checkbox _copy "Copy" pos:[16,88] width:48 height:16 checkbox _instance "Instance" pos:[80,88] width:64 height:16 checkbox _reference "Reference" pos:[152,88] width:72 height:16 listbox ListName "List Object Clone" pos:[16,32] width:208 height:2 items:obj_array button _Exit "Exit" pos:[216,120] width:144 height:24 spinner Ncopy "N_ Copy = " pos:[264,56] width:94 height:16 range:[0,9999,0] type:#integer button _update2 "Refresh List Object Clone" pos:[16,120] width:184 height:24 ------------------------------------------------------------------------------------------------- on cloneOk pressed do ( if _copy.state == true then ( for i = 1 to Ncopy.value do copyobj = copy (getNodeByName ListName.selected) ListName.items = for i in objects collect i.name removerollout clone ) if _instance.state == true then ( for i = 1 to Ncopy.value do instanceobj = instance (getNodeByName ListName.selected) ListName.items = for i in objects collect i.name removerollout clone ) if _reference.state == true then ( for i = 1 to Ncopy.value do referenceobj = reference (getNodeByName ListName.selected) ListName.items = for i in objects collect i.name removerollout clone ) objarray = for i in $* collect i.name objarray as string objarray.count if objarray.count <= 0 then messagebox "No Object to Select" title:"Select/Delete Object" else if _copy.state == false then if _instance.state == false then if _reference.state == false then ( messagebox "Select Mode Clone!" title:"Clone Object Selected" ) list.items = for i in objects collect i.name ) on _copy changed state do ( if state == true then ( _instance.state = false _reference.state = false ) else ( _copy.state = true ) ) on _instance changed state do ( if state == true then ( _copy.state = false _reference.state = false ) else ( _instance.state = true ) ) on _reference changed state do ( if state == true then ( _copy.state = false _instance.state = false ) else ( _reference.state = true ) ) on ListName selected nameIndex do select (getNodeByName ListName.items[nameIndex]) on _Exit pressed do ( removerollout clone ) on _update2 pressed do ( ListName.items = for i in objects collect i.name ) ) addrollout clone rf ) ) rollout hi "Quick Hide/Freeze Object" width:376 height:200 category:3 ( GroupBox GroupHide "Hide Object" pos:[8,8] width:176 height:184 GroupBox GroupFreeze "Freeze Object" pos:[192,8] width:176 height:184 button ho "Hide Object Selected" pos:[16,32] width:160 height:21 button uho "Hide UnSelected Object" pos:[16,64] width:160 height:21 button hiall "Hide all Object" pos:[16,96] width:160 height:21 button unhi "Unhide Object by Name" pos:[16,160] width:160 height:21 button unhiall "Unhide All Object" pos:[16,128] width:160 height:21 button frez "Freeze Object Selected" pos:[200,32] width:160 height:21 button unfreznam "Unfreeze Object by Name" pos:[200,160] width:160 height:21 button frezall "Freeze All Object" pos:[200,96] width:160 height:21 button unfrezall "Unfreeze All Object" pos:[200,128] width:160 height:21 button frezinv "Freeze Invert Object" pos:[200,64] width:160 height:21 on ho pressed do ( max hide selection ) on uho pressed do ( max hide inv ) on hiall pressed do ( select objects max hide selection ) on unhi pressed do ( max unhide by name ) on unhiall pressed do ( max unhide all ) on frez pressed do ( max freeze selection ) on frezinv pressed do ( max freeze inv ) on unfreznam pressed do ( max unfreeze by name ) on frezall pressed do ( select objects max freeze selection ) on unfrezall pressed do ( max unfreeze all ) on btn48 pressed do ( max unfreeze by name ) ) rollout Wcolor "Quick Change Color Object" width:376 height:72 category:4 ( groupBox GroupColor "Change Color Object" pos:[8,8] width:360 height:56 colorPicker _Color "Change Wireframe Color =" pos:[16,32] width:168 height:20 color:[255,255,0] modal:false button _Diffuse "Open Material Editor" pos:[200,32] width:154 height:20 on _Color changed new_col do ( selection.wirecolor = new_col ) on _Diffuse pressed do ( MatEditor.Open() ) ) rollout convert "Quick Convert Object" width:376 height:104 category:5 ( GroupBox GroupConvert "Convert Object" pos:[8,8] width:360 height:88 button _poly "Convert Object to Edit Poly" pos:[16,32] width:168 height:24 button _mesh "Convert Object to Edit Mesh" pos:[192,32] width:168 height:24 button _patch "Convert Object to Edit Patch" pos:[16,64] width:168 height:24 button _nurbs "Convert Object to NURBS" pos:[192,64] width:168 height:24 on _poly pressed do ( objarray = for i in $* collect i.name objarray as string objarray.count if objarray.count <= 0 then messagebox "No Object to Convert" title:"Convert Object" else polyobj = ConvertToPoly $ ) on _mesh pressed do ( objarray = for i in $* collect i.name objarray as string objarray.count if objarray.count <= 0 then messagebox "No Object to Convert" title:"Convert Object" else meshobj = ConvertToMesh $ ) on _patch pressed do ( objarray = for i in $* collect i.name objarray as string objarray.count if objarray.count <= 0 then messagebox "No Object to Convert" title:"Convert Object" else patchobj = convertTo $ Editable_Patch ) on _nurbs pressed do ( objarray = for i in $* collect i.name objarray as string objarray.count if objarray.count <= 0 then messagebox "No Object to Convert" title:"Convert Object" else nurbsobj = convertTo $ NURBSSurf ) ) rollout rend "Quick Render Preview" ( bitmap bmp1 "Bitmap" bitmap:(bitmap 320 240) pos:[28,8] width:320 height:240 button qrend "Quick Render Preview" pos:[90,264] width:200 height:24 on qrend pressed do ( qrend.text = "Please Wait, Rendering in progress..." StartTime = TimeStamp () bmp1.bitmap = render outputsize:[320, 240] vfb:off EndTime = TimeStamp () qrend.text = "Render Finished in " + ((EndTime-StartTime)/1000.0) as string + " sec." ) ) rollout _Info "About" width:208 height:186 ( label _0 "Quick Tools Object v.0.1" label _1 "by Michele71" label _2 "create for 3DSMax 2008/2009/2010" label _3 "release 01-5-2009" label _4 "Medal71@hotmail.it" ) addrollout QTO rf addrollout hi rf rolledUp:true addrollout Wcolor rf rolledUp:true addrollout convert rf rolledUp:true addrollout rend rf rolledUp: true addrollout _Info rf rolledUp:true